#pragma once
#include "ElementNode.h"
#include "math.h"
#include "grid3x3.h"
namespace NBGUI
{
	class GUIAPI ProgressBar: public ElementNode, public Grid3x3
	{
	public:

		ProgressBar(GUIDrawer* drawer, const char* name, const char* eleText, int eleType = NONE, Rect& _rect = Rect(), float _progress = 0);
		~ProgressBar();

		void buildVI(std::vector<Vertex>* vertices, std::vector<unsigned int>* indices,unsigned int screenWidth, unsigned int screenHeight);

		void draw();
		void refreshProgress(float deltaProgress);
		void handleEvent(Event* e);

		void doSomething(std::vector<info>& i, std::string& funcName);

	protected:
		vec2f uv[8];//back and front
		float progress;
		unsigned int backVertexOffset;
		unsigned int frontVertexOffset;


	};
}